<?
require "db.php";
require "normauth.php";
include "admin/rollerinclude.php";
printtop();

$sql="SELECT * FROM Deltakere WHERE ID=".$_SESSION['UserID'];
$rs=mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($rs) == 0)
	die ("No such user!");
else
	$user=mysql_fetch_assoc($rs);

$sql="SELECT * FROM r_Rolle WHERE eierID=".$user['ID'];
$roller=mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($roller) == 0)
	echo "Du er ikke tildelt noen rolle enda.";
else {
	while ($rolle=mysql_fetch_assoc($roller))
		completeRollebeskrivelse($rolle['ID']);
}
printbottom();


function printrow($tittel, $innhold) {
	if (!($innhold=='' || is_null($innhold))) {
		?>
		<tr>
			<th><?=$tittel?></th>
			<td><?=$innhold?></td>
		</tr>
		<?
	}
}

function printtop() {
	?>
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
	<html>
	<head>
		<title>Rollebeskrivelse</title>
		<style>
		BODY {
			font-family:	serif;
		}
		TH {
			text-align:	left;
			font-weight:	bold;
		}
		H3 {
			border-bottom: 1px solid black;
		}
		</style>
		<body>
	<?
}

function printbottom() {
	?>
	</body>
	</html>
	<?
}
			
?>
